[CPU 686]
[BITS 32]

%define EOI 20h
%define PIC1_CMD 20h

[EXTERN _kbcbuffer]
[EXTERN _putGQueue]

[GLOBAL _end_of_t1_isr]
[GLOBAL _t1_isr]

[SECTION .data]
	tempchar db 0

[SECTION .text]

_t1_isr:
	; push dos registos usados
	push eax

	xor eax, eax
	; instrucoes;
	in al, 60h
	
	
	;push eax 
	
	
	mov [tempchar], al
	push tempchar	
	push dword [_kbcbuffer]
	sti
	call _putGQueue
	cli
	add esp, 8
	
exit_t1_isr:
	; indicar a pic que terminou o processamento da interrupcao
	mov al, EOI
	out PIC1_CMD, al
	
	; pop dos registos usados
	pop eax
	
	iretd

_end_of_t1_isr: